﻿using CodeGenerator.DBInfo.entity;
using CodeGenerator.DBInfo.Impl;
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Common;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CodeGenerator.DBInfo
{
    public class DBGetterFactory
    {
        public static IDBInfoGetter GetDBGetter(DBType dBType, ConnectionInfo connInfo)
        {
            switch (dBType)
            {
                case DBType.MySQL:
                    return new MySQLDBInfoGetter(connInfo);
                case DBType.Oracle:
                    return new OracleDBInfoGetter(connInfo);
                case DBType.PostgreSQL:
                    return new PostgreSQLDBInfoGetter(connInfo);
            }
            throw new Exception("不支持的数据库");
        }
    }
}
